import { deleteBPMToken, getBPMToken, setBPMToken } from "@/utils/storage"

export default {
    namespaced: true,
    state: {
        token: getBPMToken() || ''
    },
    getters: {
    },
    mutations: {
    },
    //异步代码
    actions: {
        async setAuthTokenAsync(context, token) {
            setBPMToken(token)
            context.state.token = token
        },
        async deleteAuthTokenAsync(context) {
            deleteBPMToken()
            context.state.token = ""
        }
    }
}
